<?php
$nbrubrique=mysql_num_rows(mysql_query("SELECT id FROM rubrique WHERE titre LIKE '$page'"));
if ($page == 'Zoom')
	$page = 'page_id8';
if ($page == 'news')
	$page = 'page_id11';
?>
<div id="menugauche" <? if (preg_match("#MSIE#", $_SERVER["HTTP_USER_AGENT"])) {?>style="height:400px;"<?}?>>
<?php if (!(is_file('admin/'.$page.'.php'))) { // Menu Publique?> 
<div  style="width:160px;color:black;padding:2px;margin:2px;padding-top:7px;font-family:Arial;font-size:12px;">
	<table>
		<tr>
		<td align="right" width="150px;">
		<a href="index.php" style="color:black;font-size:12px;<?php if ($page == "homeContent"){echo 'color:'. $TheColor.'';}?>; font-size:12px;" onmouseover="$('fleche_grise<?php echo $rubrique['id']?>').style.display='block';$('fleche_color<?php echo $rubrique['id']?>').style.display='none';" onmouseout="$('fleche_grise<?php echo $rubrique['id']?>').style.display='none';$('fleche_color<?php echo $rubrique['id']?>').style.display='block'">
		<b><? if($langue == ''){?>ACCUEIL<? } if($langue == '_eng'){ ?>HOME<? } ?></b>
		</a>
		
		</td>
		<td>
			<div id="fleche_color<?php echo $rubrique['id']; ?>" style="display:block;<? if (preg_match("#MSIE#", $_SERVER["HTTP_USER_AGENT"])) {?>margin-bottom:5px;<?}?>">
				<img src="images/menu/fleche_<?php if ($page == "homeContent"){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
			</div>
			<div id="fleche_grise<?php echo $rubrique['id'];?>" style="display:none;<? if (preg_match("#MSIE#", $_SERVER["HTTP_USER_AGENT"])) {?>margin-bottom:5px;<?}?>">
				<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
			</div>
		</td>
		</tr>
	</table>
</div>


<?php
$incremente_rubrique_java=0;
$nombre_menu=mysql_num_rows(mysql_query("SELECT id FROM rubrique WHERE niveau=0"));
$nombre_sous_menu=mysql_num_rows(mysql_query("SELECT id FROM rubrique WHERE niveau!=0 AND ordre = 1"));
$incremente=1;

while ($incremente<$nombre_menu+1)
		{
		$rubrique=mysql_fetch_array(mysql_query("SELECT * FROM rubrique WHERE niveau=0 AND ordre=".$incremente));
		//recherche des sous rubriques:	
		$block_sous_rubrique = 0;
		if (is_numeric($rubriquetot['id']))
			$block_sous_rubrique = mysql_num_rows(mysql_query("SELECT * FROM rubrique WHERE id=".$rubriquetot['id']." AND niveau = ".$rubrique['id']));
		$vert = 0;
		
		$nombre_sous_rubrique=mysql_num_rows(mysql_query("SELECT * FROM rubrique WHERE niveau=".$rubrique['id']));	
		
		if ($nombre_sous_rubrique!=0)
			$incremente_rubrique_java++;
		$rubrique = mysql_fetch_array(mysql_query("SELECT * FROM rubrique WHERE niveau=0 AND ordre=".$incremente));
		
		
			?>
			<div <?php if($nombre_sous_rubrique!=0){?>id="mennu<?php echo $incremente_rubrique_java;?>"<?php } ?> style="width:160px;color:black;margin:2px;padding-top:7px;border-top: solid rgb(164,164,164) 1px;font-family:Arial;font-size:12px;">
			<table>
				<tr>
				<td align="right" width="150px;">
				<?php if($nombre_sous_rubrique == 0){?>
				<a href="index.php?page=<?php echo urlencode($rubrique['titre']);?>" style="color:black;font-size:12px;<?php if ($page == "page_id".$rubrique['id']){echo 'color:'. $TheColor.'';}?>; font-size:12px;" onmouseover="$('fleche_grise<?php echo $rubrique['id']?>').style.display='block';$('fleche_color<?php echo $rubrique['id']?>').style.display='none';" onmouseout="$('fleche_grise<?php echo $rubrique['id']?>').style.display='none';$('fleche_color<?php echo $rubrique['id']?>').style.display='block'">
				<b><?php echo stripslashes(strtoupper(stripAccents($rubrique['titre'.$langue])));?></b>
				</a>
				<?php } if($nombre_sous_rubrique != 0){?>
				<?php 
				$g_rubrique_verte = mysql_num_rows(mysql_query("SELECT * FROM rubrique WHERE id=".intval($rubriquetot['id'])." AND niveau=".$rubrique['id']));?>
				<a onclick="afficheMennu(<?php echo $incremente_rubrique_java.','.$nombre_sous_menu;?>)"style="font-size:12px;cursor:pointer; <?php if($g_rubrique_verte == 1){echo 'color:'. $TheColor.''; $vert = 1;}?>"  onmouseover="$('fleche_grise<?php echo $rubrique['id']?>').style.display='block';$('fleche_color<?php echo $rubrique['id']?>').style.display='none';" onmouseout="$('fleche_grise<?php echo $rubrique['id']?>').style.display='none';$('fleche_color<?php echo $rubrique['id']?>').style.display='block'">
				<b><?php echo stripslashes(strtoupper(stripAccents($rubrique['titre'.$langue])));?></b>
				</a>
				<?php } ?>
				</td>
				<td>
					<div id="fleche_color<?php echo $rubrique['id']; ?>" style="display:block;<? if (preg_match("#MSIE#", $_SERVER["HTTP_USER_AGENT"])) {?>margin-bottom:5px;<?}?>">
						<img src="images/menu/fleche_<?php if ($page == "page_id".$rubrique['id']){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
					</div>
					<div id="fleche_grise<?php echo $rubrique['id'];?>" style="display:none;<? if (preg_match("#MSIE#", $_SERVER["HTTP_USER_AGENT"])) {?>margin-bottom:5px;<?}?>">
						<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
					</div>
				</td>
				</tr>
			</table>
			</div>
			
			<div id="sousmennu<?php echo $incremente_rubrique_java;?>" style="<?php if ($block_sous_rubrique != 0) { echo "display:block";} else echo "display:none";?>">
			<?php
			$sous_incremente=1;
			while($sous_incremente<$nombre_sous_rubrique+1)
					{
					$sous_rubrique=mysql_fetch_array(mysql_query("SELECT * FROM rubrique WHERE niveau=".$rubrique['id']." AND ordre=".$sous_incremente));
			?>	
					<div <?php if($nombre_sous_rubrique!=0){?>id="mennu<?php echo $incremente_rubrique_java;?>"<?php } ?> style="width:160px;color: rgb(203,203,203);padding-right:5px;font-family:Arial;font-size:10px;">
						<table>
							<tr>
							<td align="right" width="150px;">							
								<a href="index.php?page=<?php echo urlencode($sous_rubrique['titre']);?>" style="font-size:9px;<?php if ($page == "page_id".$sous_rubrique['id']){echo 'color:'. $TheColor.'';}else echo 'color: #635f52';?>;" onmouseover="$('fleche_grise<?php echo $rubrique['id']?><?php echo $sous_rubrique['id']; ?>').style.display='block';$('fleche_color<?php echo $rubrique['id']?><?php echo $sous_rubrique['id']; ?>').style.display='none';" onmouseout="$('fleche_grise<?php echo $rubrique['id']?><?php echo $sous_rubrique['id']; ?>').style.display='none';$('fleche_color<?php echo $rubrique['id']?><?php echo $sous_rubrique['id']; ?>').style.display='block'">
								<b><?php echo stripslashes(strtoupper(stripAccents($sous_rubrique['titre'.$langue])));?></b>
								</a>							
							</td>
							<td>
								<div id="fleche_color<?php echo $rubrique['id']; ?><?php echo $sous_rubrique['id']; ?>" style="display:block;<? if (preg_match("#MSIE#", $_SERVER["HTTP_USER_AGENT"])) {?>margin-bottom:5px;<?}?>">
									<img src="images/menu/fleche_<?php if ($page == "page_id".$sous_rubrique['id']){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
								</div>
								<div id="fleche_grise<?php echo $rubrique['id'];?><?php echo $sous_rubrique['id']; ?>" style="display:none;<? if (preg_match("#MSIE#", $_SERVER["HTTP_USER_AGENT"])) {?>margin-bottom:5px;<?}?>">
									<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
								</div>
							</td>
							</tr>
						</table>
					</div>
					
					<?php if ($page == "page_id".$rubrique['id']){ ?><img src="images/menu/fleche_verte.gif" style="margin-left:3px;" width="5" height="9"><?php } ?>
			
			<?php		$sous_incremente++;
					}
			?>
			</div>
			
			
			
			
			<?php 
		$incremente++;
		}
		
?>
<?php } else { //Menu Administration?>

<div style="font-family:arial; font-size: 13px; padding:5px;margin:5px; margin-top:10px;padding-right:5px;">
<table>
	<tr>
	<td align="right" width="150px;">
	<a href="index.php" style="font-size:12px;<?php if ($page == "homeContent"){echo 'color:'. $TheColor.'';}?>"  onmouseover="$('fleche_grise_accueil').style.display='block';$('fleche_color_accueil').style.display='none';" onmouseout="$('fleche_grise_accueil').style.display='none';$('fleche_color_accueil').style.display='block'">RETOUR SITE</a>			
	</td>
	<td>
	<div id="fleche_color_accueil" style="display:block;">
		<img src="images/menu/fleche_<?php if ($page == "homeContent"){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	<div id="fleche_grise_accueil" style="display:none;">
		<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	</td>
	</tr>
</table>
</div>

<?php $page_menu = 'admin' ; ?>
<div style="font-family:arial; font-size: 13px; padding:5px;margin:5px; margin-top:10px;padding-right:5px;border-top: solid rgb(164,164,164) 1px;">
<table>
	<tr>
	<td align="right" width="150px;">
	<a href="index.php?page=<?php echo $page_menu?>" style="font-size:12px;<?php if ($page == $page_menu){echo 'color:'. $TheColor.'';}?>"  onmouseover="$('fleche_grise_<?php echo $page_menu?>').style.display='block';$('fleche_color_<?php echo $page_menu?>').style.display='none';" onmouseout="$('fleche_grise_<?php echo $page_menu?>').style.display='none';$('fleche_color_<?php echo $page_menu?>').style.display='block'">ACCUEIL ADMIN</a>			
	</td>
	<td>
	<div id="fleche_color_<?php echo $page_menu?>" style="display:block;">
		<img src="images/menu/fleche_<?php if ($page == $page_menu){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	<div id="fleche_grise_<?php echo $page_menu?>" style="display:none;">
		<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	</td>
	</tr>
</table>
</div>

<?php if ($_SESSION['admin']>0){?>




<?php $page_menu = 'gestionrubrique' ; ?>
<div style="font-family:arial; font-size: 13px; padding:5px;margin:5px; margin-top:10px;padding-right:5px;border-top: solid rgb(164,164,164) 1px;">
<table>
	<tr>
	<td align="right" width="150px;">
	<a href="index.php?page=<?php echo $page_menu?>" style="font-size:12px;<?php if ($page == $page_menu){echo 'color:'. $TheColor.'';}?>"  onmouseover="$('fleche_grise_<?php echo $page_menu?>').style.display='block';$('fleche_color_<?php echo $page_menu?>').style.display='none';" onmouseout="$('fleche_grise_<?php echo $page_menu?>').style.display='none';$('fleche_color_<?php echo $page_menu?>').style.display='block'"
	>LES RUBRIQUES</a>			
	</td>
	<td>
	<div id="fleche_color_<?php echo $page_menu?>" style="display:block;">
		<img src="images/menu/fleche_<?php if ($page == $page_menu){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	<div id="fleche_grise_<?php echo $page_menu?>" style="display:none;">
		<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	</td>
	</tr>
</table>
</div>

<?php $page_menu = 'gestioncategorie' ; ?>
<div style="font-family:arial; font-size: 13px; padding:5px;margin:5px; margin-top:10px;padding-right:5px;border-top: solid rgb(164,164,164) 1px;">
<table>
	<tr>
	<td align="right" width="150px;">
	<a href="index.php?page=<?php echo $page_menu?>" style="font-size:12px;<?php if ($page == $page_menu){echo 'color:'. $TheColor.'';}?>"  onmouseover="$('fleche_grise_<?php echo $page_menu?>').style.display='block';$('fleche_color_<?php echo $page_menu?>').style.display='none';" onmouseout="$('fleche_grise_<?php echo $page_menu?>').style.display='none';$('fleche_color_<?php echo $page_menu?>').style.display='block'"
	>CATEGORIES</a>			
	</td>
	<td>
	<div id="fleche_color_<?php echo $page_menu?>" style="display:block;">
		<img src="images/menu/fleche_<?php if ($page == $page_menu){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	<div id="fleche_grise_<?php echo $page_menu?>" style="display:none;">
		<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	</td>
	</tr>
</table>
</div>


<?php $page_menu = 'gestionimagepatrimoine' ; ?>
<div style="font-family:arial; font-size: 13px; padding:5px;margin:5px; margin-top:10px;padding-right:5px;border-top: solid rgb(164,164,164) 1px;">
<table>
	<tr>
	<td align="right" width="150px;">
	<a href="index.php?page=<?php echo $page_menu?>" style="font-size:12px;<?php if ($page == $page_menu){echo 'color:'. $TheColor.'';}?>"  onmouseover="$('fleche_grise_<?php echo $page_menu?>').style.display='block';$('fleche_color_<?php echo $page_menu?>').style.display='none';" onmouseout="$('fleche_grise_<?php echo $page_menu?>').style.display='none';$('fleche_color_<?php echo $page_menu?>').style.display='block'"
	>LES PHOTOS</a>			
	</td>
	<td>
	<div id="fleche_color_<?php echo $page_menu?>" style="display:block;">
		<img src="images/menu/fleche_<?php if ($page == $page_menu){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	<div id="fleche_grise_<?php echo $page_menu?>" style="display:none;">
		<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	</td>
	</tr>
</table>
</div>

<?php $page_menu = 'gestionequipe' ; ?>
<div style="font-family:arial; font-size: 13px; padding:5px;margin:5px; margin-top:10px;padding-right:5px;border-top: solid rgb(164,164,164) 1px;">
<table>
	<tr>
	<td align="right" width="150px;">
	<a href="index.php?page=<?php echo $page_menu?>" style="font-size:12px;<?php if ($page == $page_menu){echo 'color:'. $TheColor.'';}?>"  onmouseover="$('fleche_grise_<?php echo $page_menu?>').style.display='block';$('fleche_color_<?php echo $page_menu?>').style.display='none';" onmouseout="$('fleche_grise_<?php echo $page_menu?>').style.display='none';$('fleche_color_<?php echo $page_menu?>').style.display='block'"
	>L'EQUIPE</a>			
	</td>
	<td>
	<div id="fleche_color_<?php echo $page_menu?>" style="display:block;">
		<img src="images/menu/fleche_<?php if ($page == $page_menu){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	<div id="fleche_grise_<?php echo $page_menu?>" style="display:none;">
		<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	</td>
	</tr>
</table>
</div>

<?php $page_menu = 'gestionnews' ; ?>
<div style="font-family:arial; font-size: 13px; padding:5px;margin:5px; margin-top:10px;padding-right:5px;border-top: solid rgb(164,164,164) 1px;">
<table>
	<tr>
	<td align="right" width="150px;">
	<a href="index.php?page=<?php echo $page_menu?>" style="font-size:12px;<?php if ($page == $page_menu){echo 'color:'. $TheColor.'';}?>"  onmouseover="$('fleche_grise_<?php echo $page_menu?>').style.display='block';$('fleche_color_<?php echo $page_menu?>').style.display='none';" onmouseout="$('fleche_grise_<?php echo $page_menu?>').style.display='none';$('fleche_color_<?php echo $page_menu?>').style.display='block'"
	>LES ACTUALITES</a>			
	</td>
	<td>
	<div id="fleche_color_<?php echo $page_menu?>" style="display:block;">
		<img src="images/menu/fleche_<?php if ($page == $page_menu){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	<div id="fleche_grise_<?php echo $page_menu?>" style="display:none;">
		<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	</td>
	</tr>
</table>
</div>


<?php $page_menu = 'gestioncouleur' ; ?>
<div style="font-family:arial; font-size: 13px; padding:5px;margin:5px; margin-top:10px;padding-right:5px;border-top: solid rgb(164,164,164) 1px;">
<table>
	<tr>
	<td align="right" width="150px;">
	<a href="index.php?page=<?php echo $page_menu?>" style="font-size:12px;<?php if ($page == $page_menu){echo 'color:'. $TheColor.'';}?>"  onmouseover="$('fleche_grise_<?php echo $page_menu?>').style.display='block';$('fleche_color_<?php echo $page_menu?>').style.display='none';" onmouseout="$('fleche_grise_<?php echo $page_menu?>').style.display='none';$('fleche_color_<?php echo $page_menu?>').style.display='block'"
	>LES COULEURS</a>			
	</td>
	<td>
	<div id="fleche_color_<?php echo $page_menu?>" style="display:block;">
		<img src="images/menu/fleche_<?php if ($page == $page_menu){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	<div id="fleche_grise_<?php echo $page_menu?>" style="display:none;">
		<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	</td>
	</tr>
</table>
</div>

<?php $page_menu = 'ajouthotel' ; ?>
<div style="font-family:arial; font-size: 13px; padding:5px;margin:5px; margin-top:10px;padding-right:5px;border-top: solid rgb(164,164,164) 1px;">
<table>
	<tr>
	<td align="right" width="150px;">
	<a href="index.php?page=<?php echo $page_menu?>" style="font-size:12px;<?php if ($page == $page_menu){echo 'color:'. $TheColor.'';}?>"  onmouseover="$('fleche_grise_<?php echo $page_menu?>').style.display='block';$('fleche_color_<?php echo $page_menu?>').style.display='none';" onmouseout="$('fleche_grise_<?php echo $page_menu?>').style.display='none';$('fleche_color_<?php echo $page_menu?>').style.display='block'"
	>EVENEMENTS</a>			
	</td>
	<td>
	<div id="fleche_color_<?php echo $page_menu?>" style="display:block;">
		<img src="images/menu/fleche_<?php if ($page == $page_menu){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	<div id="fleche_grise_<?php echo $page_menu?>" style="display:none;">
		<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	</td>
	</tr>
</table>
</div>

<?php $page_menu = 'gestionuser' ; ?>
<div style="font-family:arial; font-size: 13px; padding:5px;margin:5px; margin-top:10px;padding-right:5px;border-top: solid rgb(164,164,164) 1px;">
<table>
	<tr>
	<td align="right" width="150px;">
	<a href="index.php?page=<?php echo $page_menu?>" style="font-size:12px;<?php if ($page == $page_menu){echo 'color:'. $TheColor.'';}?>"  onmouseover="$('fleche_grise_<?php echo $page_menu?>').style.display='block';$('fleche_color_<?php echo $page_menu?>').style.display='none';" onmouseout="$('fleche_grise_<?php echo $page_menu?>').style.display='none';$('fleche_color_<?php echo $page_menu?>').style.display='block'"
	>ADMINISTRATEURS</a>			
	</td>
	<td>
	<div id="fleche_color_<?php echo $page_menu?>" style="display:block;">
		<img src="images/menu/fleche_<?php if ($page == $page_menu){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	<div id="fleche_grise_<?php echo $page_menu?>" style="display:none;">
		<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	</td>
	</tr>
</table>
</div>

<?php $page_menu = '' ; ?>
<div style="font-family:arial; font-size: 13px; padding:5px;margin:5px; margin-top:10px;padding-right:5px;border-top: solid rgb(164,164,164) 1px;">
<table>
	<tr>
	<td align="right" width="150px;">
	<a href="index.php?page=homeContent&amp;action=logout"  onmouseover="$('fleche_grise_<?php echo $page_menu?>').style.display='block';$('fleche_color_<?php echo $page_menu?>').style.display='none';" onmouseout="$('fleche_grise_<?php echo $page_menu?>').style.display='none';$('fleche_color_<?php echo $page_menu?>').style.display='block'"
	>DECONNECTION</a>			
	</td>
	<td>
	<div id="fleche_color_<?php echo $page_menu?>" style="display:block;">
		<img src="images/menu/fleche_<?php if ($page == $page_menu){ echo 'verte';} else echo 'blanche'; ?>.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	<div id="fleche_grise_<?php echo $page_menu?>" style="display:none;">
		<img src="images/menu/fleche_grise.gif" style="margin-left:3px;" width="6" height="9">
	</div>
	</td>
	</tr>
</table>
</div>

<?php }?>
<?php }?>
</div>